//
//  DetailsImageView.m
//  PostBar
//
//  Created by lanou3g on 16/3/7.
//  Copyright © 2016年 GKZYAid. All rights reserved.
//

#import "DetailsImageView.h"

@implementation DetailsImageView

- (id)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self addAllViews];
    }
    return self;
}

- (void)addAllViews
{
    self.imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width * 0.3, self.frame.size.height)];
    [self addSubview:self.imageView1];
    
    self.imageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.imageView1.frame) + self.frame.size.width * 0.05, self.imageView1.frame.origin.y, self.imageView1.frame.size.width, self.imageView1.frame.size.height)];
    [self addSubview:self.imageView2];
    
    self.imageView3 = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.imageView2.frame) + self.frame.size.width * 0.05, self.imageView2.frame.origin.y, self.imageView2.frame.size.width, self.imageView2.frame.size.height)];
    [self addSubview:self.imageView3];
}

- (void)layoutSubviews
{
    self.imageView1.frame = CGRectMake(0, 0, self.frame.size.width * 0.3, self.frame.size.height);
    
    self.imageView2.frame = CGRectMake(CGRectGetMaxX(self.imageView1.frame) + self.frame.size.width * 0.05, self.imageView1.frame.origin.y, self.imageView1.frame.size.width, self.imageView1.frame.size.height);
    
    self.imageView3.frame = CGRectMake(CGRectGetMaxX(self.imageView2.frame) + self.frame.size.width * 0.05, self.imageView2.frame.origin.y, self.imageView2.frame.size.width, self.imageView2.frame.size.height);
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
